/**
 * Demonstrates a range of Button options the framework offers out of the box
 */
Ext.define('cloud.view.videos.VideosEdit', {
    extend: 'Ext.form.FormPanel',
    xtype: 'videosEdit',
    config: {
        title: '详情',
        items: [
            {
                xtype: 'toolbar',
                docked: 'bottom',
                layout: {
                    type: 'hbox',
                    pack: 'end'
                },
                items: [
                    {
                        id: 'videos_edit',
                        iconMask: true,
                        scope: this,
                        cls: 'x-button2',
                        text: '更新',
                        style: 'float:right'
                    },
                    {
                        id: 'videos_del',
                        iconMask: true,
                        scope: this,
                        cls: 'x-button2',
                        text: '删除',
                        style: 'float:right'
                    }
                ]
            },
            {
                xtype: 'fieldset',
                id: 'fieldset',
                title: '编辑详情',
                defaults: {
                    labelwidth: '20%',
                    xtype: 'textfield',
                    required: true,
                    clearIcon: true
                },
                items: [
                    {
                        id: 'videos_imageurl',
                        name: 'imageurls',
                        xtype:'hiddenfield'
                    },
                    {
                        id: 'videos_videourl',
                        name: 'videourls',
                        xtype:'hiddenfield'
                    },
                    {
                        name: 'aid',
                        id:"video_id",
                        hidden:true
                    },
                    {
                        id: 'videos_title_edit',
                        name: 'title',
                        label: '标题'
                    },
                    {
                        xtype: 'textareafield',
                        id: 'videos_content_edit',
                        name: 'centext',
                        label: '内容'
                    },
                    {
                        xtype: 'fieldset',
                        title: '缩略图　<span style="color:#cccccc;font-size: 15px;">（200*200）</span>',
                        cls: 'x-form-fieldset3',
                        required: true
                    },
                    {
                        xtype: 'panel',
                        style: 'margin-top: -20px;',
                        items: [
                            {
                                xtype: 'img',
                                style: ' margin-left:20px;margin-bottom:10px;height:200px;width:200px;border:1px solid #ccc;',
                                id: 'videos_edit_loadedImage',
                                required: true
                            },
                            {
                                itemId: 'videos_edit_upload',
                                xtype: 'fileupload',
                                style: ' margin:10px auto 10px 60px; width:100px; height:10px;',
                                autoUpload: true,
                                loadAsDataUrl: true,
                                states: {
                                    browse: {
                                        text: '上传图片'
                                    },
                                    ready: {
                                        text: 'Load'
                                    },
                                    uploading: {
                                        text: 'Loading',
                                        loading: true
                                    }
                                }
                            }
                        ]
                    },
                    {
                        xtype: 'fieldset',
                        title: '视频　<span style="color:#cccccc;font-size: 15px;">（320*160）</span>',
                        cls: 'x-form-fieldset3',
                        required: true
                    },
                    {
                        xtype: 'panel',
                        style: 'float:left;padding-left:10px;',
                        items: [
                            {
                                xtype    : 'label',
                                id: 'videos_edit_loadedImage_two',
                                style: ' margin-left:20px;margin-bottom:10px;height:30px;width:200px;'
                            },
                            {
                                itemId: 'videos_edit_upload_two',
                                xtype: 'fileupload',
                                style: ' margin:0 auto;margin-bottom:10px; width:100px; height:10px;margin-bottom:20px;',
                                autoUpload: true,
                                loadAsDataUrl: true,
                                states: {
                                    browse: {
                                        text: '上传视频'
                                    },
                                    ready: {
                                        text: 'Load'
                                    },
                                    uploading: {
                                        text: 'Loading',
                                        loading: true
                                    }
                                }
                            }
                        ]
                    }

                ]
            }
        ]
    }
});